#include <stdio.h>
#include <stdlib.h>
#include "Exercise.h"

int Exercise::Factorial(int n)
{
	if (n <= 1) return 1;
	else return n*Factorial(n-1);	
}

int Exercise::Fibonacci(int n)
{
	if (n == 0) return 0;
	else if (n == 1) return 1;
	else return Fibonacci(n-1) + Fibonacci(n-2);	
}

void Exercise::Hanoi(int n, char chA, char chB, char chC)
{
	if(n==1) {
		printf("move %c to %c\n", chA, chC);
		return;
	}

	Hanoi(n-1, chA, chC, chB);
	printf("move %c to %c\n", chA, chC);
	Hanoi(n-1, chB, chA, chC);		
}
